<?php
class RegistroAliadoHelper extends Helper{  
   
	public function existen_registros($mes, $year, $zona_id) {
        App::import('Model', 'RegistroAliado');
        $this->RegistroAliado = new RegistroAliado;         
        $this->data = $this->RegistroAliado->find('count', array('fields'=>'RegistroAliado.id', 
        												   'conditions'=>array('RegistroAliado.mes'=>$year."-".$mes, 'RegistroAliado.zona_id'=>$zona_id)));
        return $this->data;
   }
   
	public function registro_mes($aliado, $fecha){
   	 	App::import('Model', 'RegistroAliado');
        $this->RegistroAliado = new RegistroAliado;
        $this->data = $this->RegistroAliado->find('first', array('all', 'conditions'=>array('RegistroAliado.id'=>$aliado, 
        													'AND'=>array('RegistroAliado.mes'=>$fecha))));        
        return $this->data;
   }
} 
?>